// eslint-disable-next-line no-undef
const TerserPlugin = require("terser-webpack-plugin");

// eslint-disable-next-line no-undef
module.exports = {
  terserPlugin: () => {
    return new TerserPlugin({
      parallel: true,
      terserOptions: {
        ecma: undefined,
        warnings: false,
        parse: {},
        compress: {
          drop_console: true,
          drop_debugger: true,
          pure_funcs: ["console.log"] // 移除console
        }
      }
    });
  }
};
